
use WebSecurity;
GO
-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_CATALOG = N'WebSecurity' 
	 AND SPECIFIC_SCHEMA = N'dbo'
     AND SPECIFIC_NAME = N'Membership_GetOne' 
)
   DROP PROCEDURE dbo.Membership_GetOne
GO
create procedure dbo.Membership_GetOne
@MembershipID Int = null OUTPUT,
	@RowsAffected int = null OUTPUT 
	
--*************************************************************
--Created By: trooks
--Name: dbo_Membership_GetOne
--Table: Membership 
--Schema: dbo
--Database: WebSecurity
--Created Date: 01/21/2013 00:00:00
--*************************************************************

as
	Begin Try
		Select 
		MembershipID, 
		ConfirmationToken, 
		IsConfirmed, 
		LastPasswordFailureDate, 
		PasswordFailuresSinceLastSuccess, 
		Password, 
		PasswordChangedDate, 
		PasswordSalt, 
		PasswordVerificationToken, 
		PasswordVerificationTokenExpirationDate, 
		TS, 
		CreatedBy, 
		CreatedDt, 
		ModifiedBy, 
		ModifiedDt, 
		EmailAccount, 
		PasswordAnswer, 
		LastLoginDate, 
		LastLockoutDate, 
		UserId, 
		PasswordQuestionID 
		From [dbo].Membership
		 where
		 @MembershipID = MembershipID

		Set @RowsAffected = @@ROWCOUNT;
		return 0;	
	END TRY
	BEGIN CATCH
		Set @RowsAffected = 0;
		EXEC dbo.uspLogError;
		return -1;
	END CATCH
	
GO
GRANT EXECUTE ON [WebSecurity].[dbo].[Membership_GetOne] to PORTAL_WebSecurity
GO